package com.juli.school.dao.base;

import java.io.Serializable;
import java.util.Date;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.juli.school.utils.dao.base.Page;

/**
 * @Description: 基础实体类
 * @author gaoxiang
 * @date 2017年8月23日 下午9:06:16
 */
public class BaseEntity implements Serializable {
	
	/**
	 * @Fields id : 主键id，自增
	 */
	protected Integer id;
	
	/**
	 * @Fields gmtCreate : 创建时间
	 */
	private Date gmtCreate;
	
	/**
	 * @Fields gmtUpdate : 更新时间
	 */
	private Date gmtUpdate;
	
	/**
	 * @Fields page : 分页对象
	 */
	private Page page;
	
	public Integer getId() {
		return id;
	}
	
	public void setId(Integer id) {
		this.id = id;
	}
	
	public Page getPage() {
		return page;
	}
	
	public void setPage(Page page) {
		this.page = page;
	}
	
	public Date getGmtCreate() {
		return gmtCreate;
	}
	
	public void setGmtCreate(Date gmtCreate) {
		this.gmtCreate = gmtCreate;
	}
	
	public Date getGmtUpdate() {
		return gmtUpdate;
	}
	
	public void setGmtUpdate(Date gmtUpdate) {
		this.gmtUpdate = gmtUpdate;
	}
	
	public String toString() {
		try {
			return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
		} catch (Exception e) {
			// 大部分情况下，toString()用在日志输出等调试场景
			return super.toString();
		}
	}
}
